package presenter.record;

import utils.FileBean;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class HuaweiRecorderImpl implements IRecorder {
    @Override
    public Pattern pattern() {
        return Pattern.compile("SVID_(\\d+)_(\\d+)_(\\d+).mp4");
    }

    @Override
    public String rename(FileBean bean, Matcher matcher) {
        String date = matcher.group(1);
        String time = matcher.group(2);
        String num = matcher.group(3);
        String toName = String.format("%s-%s-%s.mp4", date, time, num);
        return IRecorder.fixedPath(bean.parent(), toName);
    }
}
